unit CadastroAtividadeEconomica;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, UFomCadastro, Mask, DBCtrls, DB, DBClient, Provider, DBTables,
  Menus, StdCtrls, ComCtrls, Buttons, Grids, DBGrids, ExtCtrls;

type
  TFCadastroAtividadeEconomica = class(TFormCadastro)
    cdsCadastroAE_CODIGO: TIntegerField;
    cdsCadastroAE_DESCRICAO: TStringField;
    cdsCadastroUSUARIO: TStringField;
    cdsCadastroDATAMODIFICACAO: TDateTimeField;
    cdsCadastroUSUARIO_CADASTRO: TStringField;
    cdsCadastroUSUARIO_AUTERACAO: TStringField;
    cdsCadastroUSUARIO_EXCLUSAO: TStringField;
    cdsCadastroDATA_CADASTRO: TDateTimeField;
    cdsCadastroDATA_EXCLUSAO: TDateTimeField;
    cdsCadastroDATA_AUTERACAO: TDateTimeField;
    cdsCadastroEXCLUIDO: TStringField;
    cdsCadastroUSUARIO_RECUPERACAO: TStringField;
    cdsCadastroDATA_RECUPERACAO: TDateTimeField;
    Label1: TLabel;
    Label2: TLabel;
    edCodigo: TDBEdit;
    edDescricao: TDBEdit;
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
    procedure BtnIncluirClick(Sender: TObject);
    procedure FormCreate(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  FCadastroAtividadeEconomica: TFCadastroAtividadeEconomica;

implementation

uses UGestao, UGeral;

{$R *.dfm}

procedure TFCadastroAtividadeEconomica.FormClose(Sender: TObject;
  var Action: TCloseAction);
begin
  inherited;
  FCadastroAtividadeEconomica.Release;
  FCadastroAtividadeEconomica := Nil;
end;

procedure TFCadastroAtividadeEconomica.BtnIncluirClick(Sender: TObject);
begin

  inherited;

  edCodigo.Field.AsInteger := Retorna_Codigo_Generetor('GEN_ATIVIDADE_ECONOMICA');
  edDescricao.SetFocus;

end;

procedure TFCadastroAtividadeEconomica.FormCreate(Sender: TObject);
begin
  QCadastro.SQL.Clear;
  QCadastro.SQL.Add('SELECT * FROM ATIVIDADE_ECONOMICA');
  inherited;

end;

end.
